home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -screenplay- / hd_installers / -whdload- / whdload_dev / rawdic17.lha / Examples / Xenomorph.islave.asm < prev   
Assembly Source File  |  1999-03-03  |  3KB  |  91 lines

  1.  
  2.     ; Xenomorph imager (can easily adapted for Galdregons Domain)
  3.  
  4.     ; Xenomorph is in standard Amiga format, except for tracks 2 and 3
  5.     ; which contain the copy protection.
  6.  
  7.     ; The disk is NDOS but contains a custom directory format. The
  8.     ; directory is stored at offset $0400 and is built up like this:
  9.  
  10.     ; 16 bytes filename
  11.     ; 1 longword filelength
  12.     ; 1 word startblock
  13.  
  14.     ; This repeats until an empty filename.
  15.  
  16.  
  17.         incdir    Includes:
  18.         include    RawDIC.i
  19.  
  20.         SLAVE_HEADER
  21.         dc.b    1    ; Slave version
  22.         dc.b    0    ; Slave flags
  23.         dc.l    DSK_1    ; Pointer to the first disk structure
  24.         dc.l    Text    ; Pointer to the text displayed in the imager window
  25.  
  26.         dc.b    "$VER:"
  27. Text:        dc.b    "Xenomorph imager V1.0",10,"by John Selck on 03.03.1999",0
  28.         cnop    0,4
  29.  
  30. DSK_1:        dc.l    DSK_2        ; pointer to next disk structure
  31.         dc.w    1        ; disk structure version
  32.         dc.w    0        ; flags (look below)
  33.         dc.l    TL_1        ; list of tracks which contain data
  34.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  35.         dc.l    FL_NOFILES    ; list of files to be saved
  36.         dc.l    0        ; table of certain tracks with CRC values
  37.         dc.l    0        ; alternative disk structure, if CRC failed
  38.         dc.l    0        ; called before a disk is read
  39.         dc.l    DC_Xenomorph    ; called after a disk has been read
  40.  
  41. DSK_2:        dc.l    0        ; pointer to next disk structure
  42.         dc.w    1        ; disk structure version
  43.         dc.w    0        ; flags (look below)
  44.         dc.l    TL_1        ; list of tracks which contain data
  45.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  46.         dc.l    FL_NOFILES    ; list of files to be saved
  47.         dc.l    0        ; table of certain tracks with CRC values
  48.         dc.l    0        ; alternative disk structure, if CRC failed
  49.         dc.l    0        ; called before a disk is read
  50.         dc.l    DC_Xenomorph    ; called after a disk has been read
  51.  
  52. TL_1:        TLENTRY    0,1,$1600,SYNC_STD,DMFM_STD
  53.         TLENTRY    2,3,$1600,SYNC_INDEX,DMFM_NULL    ; copy protection tracks
  54.         TLENTRY    4,159,$1600,SYNC_STD,DMFM_STD
  55.         TLEND
  56.  
  57. DC_Xenomorph:
  58.         moveq    #0,d0
  59.         jsr    rawdic_ReadTrack(a5)    ; read track containing directory
  60.         add.w    #$0400,a1
  61.  
  62. .l1        tst.b    (a1)
  63.         beq.b    .out
  64.         move.l    a1,a0
  65.         moveq    #$0f,d1
  66. .l0        move.b    (a0)+,d0
  67.     ;cmp.b    #":",d0            ; this is not for xenomorph, but
  68.     ;blo.b    .s0            ; galdr.domain, some filenames
  69.     ;cmp.b    #";",d0            ; contain ":" and ";". especially
  70.     ;bhi.b    .s0            ; the ":" causes trouble with dos
  71.     ;sub.b    #":"-"A",d0
  72. .s0    ;move.b    d0,-1(a0)
  73.         dbeq    d1,.l0
  74.         subq.l    #1,a0
  75.         cmp.l    #".FLR",-(a0)    ; for xenomorph: the floor tiles have
  76.         bne.b    .s1        ; a ".FLR" extension, but the loader
  77.         clr.l    (a0)        ; does not use this extension.
  78. .s1
  79.         move.l    a1,a0
  80.         move.l    $10(a0),d1
  81.         move.w    $14(a0),d0
  82.         mulu.w    #$0200,d0
  83.         jsr    rawdic_SaveDiskFile(a5)
  84.         add.w    #$16,a1
  85.         bra.b    .l1
  86. .out
  87.         moveq    #IERR_OK,d0
  88.         rts
  89.  
  90.  
  91.